import request from '@/utils/request'

// 查询客户列表
export function listCustomer(query) {
  return request({
    url: '/biz/customer/list',
    method: 'post',
    data: query
  })
}

// 查询客户详细
export function getCustomer(id) {
  return request({
    url: '/biz/customer/' + id,
    method: 'get'
  })
}

// 新增客户
export function addCustomer(data) {
  return request({
    url: '/biz/customer',
    method: 'post',
    data: data
  })
}

// 修改客户
export function updateCustomer(data) {
  return request({
    url: '/biz/customer',
    method: 'put',
    data: data
  })
}

// 删除客户
export function delCustomer(id) {
  return request({
    url: '/biz/customer/' + id,
    method: 'delete'
  })
}

// 客情维护列表
export function listByCustomerId(data) {
  return request({
    url: '/biz/customerRelationship/listByCustomerId',
    method: 'POST',
    data
  })
}

// 添加修改客情维护项
export function customerRelationship(data) {
  return request({
    url: '/biz/customerRelationship',
    method: data.id ? 'PUT' : 'POST',
    data
  })
}
// 删除客情维护
export function delRelationship(id) {
  return request({
    url: '/biz/customerRelationship/' + id,
    method: 'delete'
  })
}
// 导入
export function importCustomer(data) {
  return request({
    url: '/biz/customer/import',
    method: 'post',
    data: data
  })
}

